From: Philip Withnall Date: Mon, 7 Aug 2017 18:50:40 +0000 (+0100) Subject: lib/repo-pull: Add a missing precondition X-Git-Tag: archive/raspbian/2022.1-3+rpi1~1^2~4^2~33^2~33 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https:/%22bookmarks:///%22http:/www.example.com/cgi/%22https:/%22bookmarks:/?a=commitdiff_plain;h=11e165b154bbf35915eaea62bf36e4cd30acb1c1;p=ostree.git lib/repo-pull: Add a missing precondition This catches a few failure modes in the pull code a little earlier, before the incorrectly-NULL repo makes its way into a closure and a worker thread, where the cause of the problem is harder to track down. Signed-off-by: Philip Withnall Closes: #1058 Approved by: cgwalters --- diff --git a/src/libostree/ostree-repo-pull.c b/src/libostree/ostree-repo-pull.c index ed616a81..8c0c4ff1 100644 --- a/src/libostree/ostree-repo-pull.c +++ b/src/libostree/ostree-repo-pull.c @@ -3270,6 +3270,7 @@ ostree_repo_pull_with_options (OstreeRepo *self, (void) g_variant_lookup (options, "localcache-repos", "^a&s", &opt_localcache_repos); } + g_return_val_if_fail (OSTREE_IS_REPO (self), FALSE); g_return_val_if_fail (pull_data->maxdepth >= -1, FALSE); g_return_val_if_fail (!opt_collection_refs_set || (refs_to_fetch == NULL && override_commit_ids == NULL), FALSE);